# -!- coding: utf-8 -!-
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
 存放api接口信息。以dict形式存放，这样就可以API_ALL[''][url]这种方式去取，看起来较直观，知道取得是哪个接口的那部分信息
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
import json

# 接口响应
API_response={
    "act_capital_query": {
        "rspCd": "00000",
        "rspInf": "交易成功",
        "responseTm": "20200511112225",
        "actualOrgSts": "S",
        "actualOrgMsg":"交易成功",
        "actualOrgId": "ZMRD001",             # 数据库配置
        "actualOrgNm":"仁东互联网小额贷款"      # 写死
    },
    "act_capital_query_err":{
        "responseTm":"20200511174553",
        "rspCd":"1043",
        "rspInf":"字段格式错误,字段(productId)为空"
    },
    "loan_apply":{
        "rspCd": "00000",
        "rspInf": "交易成功",
        "responseTm": "20200511180356",
        "loanApprovalStatus": "S",
        "loanApprovalInfo":"成功",
        "orgOrderNo": "CW20200511OL000006",
        "orgOrderDt":"20200511",
    },
    "loan_apply_F":{
        "rspCd": "00000",
        "rspInf": "交易成功",
        "responseTm": "20200511180356",
        "businessRspCd": "10020",
        "loanApprovalInfo": "借款订单号已存在,不可重复申请",
        "loanApprovalStatus": "F",
    },
    "loan-result-notify":{
        "journalNo": "CN14820200511180356",          # 18位长度CN+2位随机数+yyyymmddhhmmss
        "requestTime": "20200511180356",
        "clientId": "37740",                         # 配置文件（加密）
        "subClientId": "MSXD",
        "version": "1.0",
        "signType": "RSA",
        "appVersion": "001",
        "osVersion": "001",
        "terminalType": "pc",
        "terminalId": "T001",
        "deviceId": "001",

        "brwOrdNo":"560202005110000004",
        "brwOrdDt": "20200510",
        "creditAmount":"1000.00",
        "loanApprovalStatus": "S",
        "loanApprovalInfo":"成功",
        "orgOrderNo": "CW20200511OL000006",
        "orgOrderDt":"20200511"
    },
    "loan_result_query":{
        "rspCd": "00000",
        "rspInf": "交易成功",
        "responseTm": "20200512103137",
        "creditAmount":"1000.00",
        "loanApprovalStatus":"S",
        "orgOrderNo": "CW20200512OL000006",
        "orgOrderDt":"20200512"
    },
    "loan_result_query_F": {
        "rspCd": "00000",
        "rspInf": "交易成功",
        "responseTm": "20200512103137",
        "businessRspCd":"10019",      # 10017-订单不存在
        "creditAmount":"0",
        "loanApprovalStatus": "F",
        "loanApprovalInfo":"综合评分不足",
        "orgOrderNo": "CW20200512OL000006",
        "orgOrderDt":"20200512"
    },
    "loan_result_query_err": {
        "rspCd": "1043",
        "rspInf":"字段格式错误,字段(brwOrdDt)为空",
        "responseTm":"20200512104149"
    },
    "unfreeze": {
        "rspCd": "00000",
        "rspInf": "交易成功",
        "responseTm": "20200512104809",
        "thawStatus": "S"
    },
    "unfreeze_err": {
        "rspCd": "1043",
        "rspInf":"字段格式错误,字段(brwOrdDt)为空",
        "responseTm":"20200512105039"
    },
    "package_notify":{
        "rspCd": "00000",
        "rspInf": "交易成功",
        "responseTm": "20200512110210",
        "noticeReslt": "S"
    },
    "package_notify_F": {
        "rspCd": "99998",
        "rspInf": "业务办理=====》案件状态不是可以授信状态，orgOrderNo:CW20200512OL000008",
        "responseTm": "20200512111204",
        "noticeReslt": "F",
    },
    "repayment_plan_query":{
        "rspCd": "00000",
        "rspInf": "交易成功",
        "responseTm": "20200512111737",
        "planList":[{
            "orgOrdNo": "CW20200512OL000006",
            "totalSeqCount": 24,
            "seqNo": 1,
            "repayDay": "20200601",
            "repaySts": "0",           # 0未还/1已还
            "repayAmount": 51.25,      # 当期总金额：本金+利息+手续+逾期
            "capitalAmount":41.67,
            "interestAmount":9.58,
            "lateFee":0,               # 逾期服务费
            "serviceFee":0,            # 手续服务费
            }
        ],
    },
    "repayment": {
        "rspCd": "00000",
        "rspInf": "交易成功",
        "responseTm": "20200512115521",
        "planList": [{
            "orgOrdNo": "CW20200509OL000003",
            "totSeqCnt": 24,
            "repayDay": "20200601",
            "seqNo": 1,
            "repaySts": "0",
            "repayAmount": 1000.0,
            "capitalAmount": 1000.0,
            "interestAmount": 0,
            "lateFee": 0,
            "serviceFee": 0,
            }
        ],
    },
    "repayment_err": {
        "rspCd":"1043",
        "rspInf":"字段格式错误,字段(repayModel)为空",
        "responseTm":"20200512141405",
        "planList":[]
    },
    "returns_F": {
        "rspCd": "00000",
        "rspInf": "交易成功",
        "responseTm": "20200513103348",
        "refundGoodsStatus": "F",
        "refundGoodsInfo": "未查询到退货记录",
        "refundTotalAmount": 0,
        "refundUserAmount": 0,               #　需要用户额外支付的手续费用
        "refundCaptalAmount": 0,
        "userAmountDeductionFlg": "N"          # 手续费是否已抵扣
    },

}